package cn.felord.r2dbc.controller;

import cn.felord.r2dbc.domain.ClientUser;
import cn.felord.r2dbc.service.ClientUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;


@RestController
@RequestMapping("/user")
public class ReactiveClientUserController {

    @Autowired
    private ClientUserService service;


    @GetMapping("/{userId}")
    public Mono<ClientUser> findUserById(@PathVariable String userId) {
        return service.findById(userId);
    }


}
